#include <iostream>
#define N 100

using namespace std;

void readcharVector(char array[], int elements){
int i;
for(i=0;i<elements;i++){
    cout<<"a["<<i<<"]=";
    cin>>array[i];
    cout<<"\n";}
}

void reverse(char array[],int elements, int nr){
	int i=0,j=elements-1;
	int aux;
	while (i<nr){
		aux=array[i];
		array[i]=array[j];
		array[j]=aux;
		++i;
		--j;}
}


void printcharVector(char array[], int elements){
int i;
for(i=0;i<elements;i++){
    cout<<array[i]<<" ";}
	cout<<"\n";
}


int main(){
int elements, nr;
char array[N];
cout<<"Type the number of elements you want int the array: ";
cin>>elements;
readcharVector(array, elements);
cout<<"Number of elements to swap : " ;
cin>>nr;
reverse(array, elements, nr);
printcharVector(array, elements);

return 0;
}
